package com.linq.cool.beauty.domain;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @Author: yqlin
 * @Date: 2021/2/5 17:25
 * @Description: 美容项目产品Es
 * @Version: 1.0.0
 */
@Data
@Accessors(chain = true)
@Document(indexName = "product")
public class BeautyEsProduct implements Serializable {
    /**
     * id
     */
    @Id
    private String id;

    /**
     * 商品名称
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String name;


    /**
     * 商品图片
     */
    @Field(type = FieldType.Keyword)
    private String pic;


    /**
     * 品牌ID
     */
    @Field(name = "brand_id", type = FieldType.Long)
    private Long brandId;

    /**
     * 品牌名称
     */
    @Field(name = "brand_name", type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String brandName;


    /**
     * 商品分类id
     */
    @Field(name = "product_category_id", type = FieldType.Long)
    private Long productCategoryId;


    /**
     * 商品价格
     */
    @Field(type = FieldType.Double)
    private BigDecimal price;

    /**
     * 可获得积分
     */
    @Field(type = FieldType.Double)
    private BigDecimal point;

    /**
     * 销量
     */
    @Field(type = FieldType.Integer)
    private Integer sale;


    /**
     * 商品描述
     */
    @Field(name = "p_desc", type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String pDesc;

    /**
     * 详情内容
     */
    @Field(name = "content", type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String content;

    /**
     * 排序
     */
    @Field(type = FieldType.Integer)
    private Integer sort;
}